#include <iostream>
using namespace std;

class Base{
public:
    Base(long x)
    : _base(x)
    {
        cout << "Base()" << endl;
    }
    
    long _data = 100;

    void print() const{
        cout << "Base::_base:" << _base << endl;
        cout << "Base::_data:" << _data  << endl;
    }
private:
    long _base;
};

class Derived
: public Base
{
public:
    Derived(long base,long derived)
    : Base(base)//初始化基类子对象
    , _derived(derived)
    {
        cout << "Derived()" << endl;
    }
    
    long _data = 19;

    void print(int x) const{
        cout << "Derived::_derived:" << _derived << x <<  endl;
        cout << "Derived::_data:" << _data << x << endl;
    }
private:
    long _derived;

};

void test0(){
    cout << "执行结果为:" << endl;
    Derived dd(1,2);
    cout << dd._data << endl;
    cout << dd.Base::_data << endl;
    dd.print(1);
    // dd.print();

}

int main(void){
    test0();
    return 0;
}

